Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

178
Views
[Vue warn]: Error in v-on handler: "TypeError: Object(...)(...).httpsCallable(...).then is not a function"

I'm trying to call this firebase cloud functions from my Vue app

exports.sayHi = functions.https.onCall((data, context) =>{
  return "hi";
});

This is my action in the store

import {
  getFirebaseDB,
  getFirebaseFunctions,
} from "../../helpers/firebase/authUtils";

reserveApt() {
    getFirebaseFunctions()
      .httpsCallable("sayHi")
      .then((result) => {
        console.log(result);
      });
  },

and this is my helper functions in ../../helpers/firebase/authUtils:

import firebase from "firebase/app";
import "firebase/auth";
import "firebase/firestore";
import "firebase/functions";

/**
 * Initilize the backend
 * @param {*} config
 */
const initFirebaseBackend = (config) => {
  if (!_fireBaseBackend) {
    _fireBaseBackend = new FirebaseAuthBackend(config);
    _db = firebase.firestore();
    _functions = firebase.functions();
  }
  return _fireBaseBackend;
};


/**
 * Returns the firebase backend
 */
const getFirebaseBackend = () => {
  return _fireBaseBackend;
};


/**
 * returns firestore db
 */
const getFirebaseDB = () => {
  if (!_db) {
    _db = firebase.firestore();
  }
  return _db;
};


/**
 * returns firebase functions
 */
const getFirebaseFunctions = () => {
  if (!_functions) {
    _functions = firebase.functions();
  }
  return _functions;
};


export {
  initFirebaseBackend,
  getFirebaseBackend,
  getFirebaseDB,
  getFirebaseFunctions,
};

Firebase is properly initialized and all the other functions like auth and firestore work perfectly but when I call this I get this error:

[Vue warn]: Error in v-on handler: "TypeError: Object(...)(...).httpsCallable(...).then is not a function"

found in

---> <Properties> at src/views/pages/property/properties.vue
       <App> at src/App.vue
         <Root>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

So apparently the problem was in calling the function. I had to call it like this:

var reserve = getFirebaseFunctions().httpsCallable("sayHi");
    reserve().then((result) => {
      console.log(result);
    });

but I'm not sure why!!

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!